﻿/// <reference path="../jquery-3.4.1.min.js" />
/// <reference path="../common.js" />

var viewId = '';

$(function () {

    viewId = getUrlParam('id');

    var currDate = $('#hidCurrentDate').val();
    $('#SearchStartTime').val(currDate);

    GetMainList(1, 15);
    $('#btnSearch').click(function () {
        GetMainList(1, $('#pager').getPager().PageSize);
    });
});

//绑定列表
function GetMainList(vPageIndex, vPageSize) {
    var postData = $('#searchBlock').getData('GetUserScheduleList');
    postData.pgIndex = vPageIndex;
    postData.pgSize = vPageSize;
    postData.UserId = viewId;

    $.rajax('handler/scheduleManagement.ashx', postData, function (retobj) {
        var dataList = retobj.data.Table;
        
        $('#dataTable').bindTable(dataList, false);
        $('#pager').setPager(retobj.data.PageInfo, GetMainList);
    });
}
